(function($) {
  $.fn.getProductDetail = function(options) {
    options = $.extend({
      lookupResource: '../../sys/com/control/SupplierServices.php?action=getOutHistoryOrderList'    
    },options||{});    
      $.ajax({
        url: options.lookupResource,
        type: 'get',
        data: options,
        dataType: 'html',
        success: function(data) {
        	data=jQuery.parseJSON(data);
        	if(data.length>0){

        		var txtLength=30;

	        	var inner='<table id="table1" width="729" cellspacing="0" cellpadding="0">';

	        	$.each(data,
	        		function(index,value){
	        		inner+='<tr>';
	        		inner+='<td width="226" align="center">'+value.ol_id+'</td>';
	                inner+='<td width="222" align="center">'+value.name+'</td>';
	                inner+='<td width="126" align="center">'+value.orderDate+'</td>';
	                inner+='<td width="149" align="center"><a href="supplier_order_history_infor.php?ol_id='+value.ol_id+'">出貨單資料</a></td>';
	                inner+='</tr>';
	              
	             	        	});
	        	inner+="</table>";
	        	
        	}else{
        		inner="目前無資料";
        	}
        	$('#orderListDetail').html("").html(inner);
        	
        	$("#table1").tablePagination();
          },
          error : function(data){
        	  alert(data);
          }
        });
  }
})(jQuery);
//function openProductDetail()
//{
//	window.location='/shopcarda1/List_pages/contant/content.php';
//}
$(document).ready(
	function(){
		var option={
		'cm_id':getCm_id()
//		orderByField : 'sell_price'
		};

		$('#productDetail').getProductDetail(option);
	}
);
